package com.changgou.aspect;

import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

import javax.annotation.Priority;

@Aspect
@Component
public class CheckEAspect {

    @Pointcut("@annotation(com.changgou.annotation.adminOnly)")
    public void checkAdmin(){

    }

    @Before("checkAdmin()")
    public void checkAdmins(){
        System.out.println("拦截到了！adminOnly");
    }


    @After("checkAdmin()")
    public void che () {

        System.out.println("之后");
    }

}
